# Maintainer: Krassy Boykinov <kboykinov@teamcentrixx.com>
pkgname=hwloc
pkgver=2.10.0
pkgrel=0
pkgdesc="Portable abstraction of hierarchical hardware architectures"
url="https://www.open-mpi.org/"
arch="all"
license="BSD-3-Clause"
makedepends="cairo-dev eudev-dev libxml2-dev ncurses-dev"
case "$CARCH" in
	arm*) true;;
	*) makedepends="$makedepends numactl-dev";;
esac
options="!check" # fails on multiple arches with different tests
subpackages="
	$pkgname-dev
	$pkgname-doc
	$pkgname-bash-completion
	$pkgname-tools
	"
source="https://www.open-mpi.org/software/hwloc/v${pkgver%.*}/downloads/hwloc-$pkgver.tar.bz2"

build() {
	./configure \
		--prefix=/usr \
		--sbindir=/usr/bin \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	rm "$pkgdir"/usr/share/hwloc/hwloc-dump-hwdata.service
}

doc() {
	default_doc

	amove usr/share/hwloc/hwloc-ps.www
	amove usr/share/hwloc/hwloc*.dtd
}

tools() {
	pkgdesc="Portable hardware locality tools"

	amove usr/bin
	amove usr/share/applications/lstopo.desktop
}

sha512sums="
8fcf448ef16874862e5cf5a814ecc4885d53817369640bb8a0079b0c7d9294b3933a6a8cf2472e8e104a5c346e09e1fffab401a1976d7b2da0457f0c5271a18a  hwloc-2.10.0.tar.bz2
"
